using System;
using System.Collections.Generic;
using System.Text;
using Pixysoft.Tools;
using Pixysoft.Weblications.Sango.Formular;
using Pixysoft.Framework.Verifications;
using Pixysoft.Framework.Noebe;
using Pixysoft.Weblications.Sango.Entities;

namespace Pixysoft.Weblications.Sango.Environment
{

    public class WarOfficerteamHelper
    {
        static List<War_Officerteam> orms = new List<War_Officerteam>();

        public static void initialize()
        {
            orms = SettingHelper.GetNoebe().EntityNoebeCommand.Select<War_Officerteam>();

            LoggerHelper.Info("initialize War_Officerteam.count{0}", orms.Count);
        }

        public static List<War_Stage> searchRveteams(long stagecode)
        {
            List<War_Stage> teams = new List<War_Stage>();

            foreach (War_Officerteam team in searchTeamSettings(stagecode))
            {
                teams.Add(WarStageHelper.searchStageByCode(team.Stageserialcode));
            }

            return teams;
        }

        private static List<War_Officerteam> searchTeamSettings(long stagecode)
        {
            List<War_Officerteam> list = new List<War_Officerteam>();

            foreach (War_Officerteam team in orms)
            {
                if (team.Stageserialcode == stagecode)
                {
                    list.Add(team);
                }
            }

            return list;
        }

    }
}